<?php

namespace MLM;

use MLM\Controller\MemberController;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\EventManager\EventManagerInterface;

class Module implements AutoloaderProviderInterface, ConfigProviderInterface {

    public function getAutoloaderConfig() {
        return array(
            'Zend\Loader\StandardAutoloader' => array(
                'namespaces' => array(
                    __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
                ),
            ),
        );
    }

    public function getConfig() {
        return include __DIR__ . '/config/module.config.php';
    }

//put your code here
    /*
    public function getControllerConfig() {
        return array(
            'factories' => array(
                'MLM\Controller\MemberController' => function($sm) {
                    $events = $sm->getServiceLocator()->get('EventManager');
                    $controller = new MemberController();
                    $events->attach('dispatch', function ($e) use ($controller) {
                        $auth = new AuthenticationService();

                        if (!$auth->hasIdentity()) {
                            return $this->redirect()->toRoute('application/default', array('controller' => 'Index', 'action' => 'login'));
                        }
                    }, 100); // run before controller action logic 

                    $controller->setEventManager($events);
                    return $controller;
                }
            ),
        );
    }
     * 
     */

}
